package com.company;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

/**
 * @author jrue
 * @version 1.0
 * @date 2020/3/17 20:43
 */
public class Main08 {

    public char getFirstRepeatChar (String s) {
        // write code here
        HashSet<Character> set = new HashSet<>();
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (set.contains(chars[i])) {
                return chars[i];
            } else {
                set.add(chars[i]);
            }
        }
        return s.charAt(0);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        HashSet<Character> set = new HashSet<>();

        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (set.contains(chars[i])) {
                System.out.println(chars[i]);
                return;
            } else {
                set.add(chars[i]);
            }
        }
    }

}
